#!/bin/sh

#py_flag="python_3.7.4"
py_flag="pypy_7.2.0"
#py_flag="pypy6.0_ddcCommon"
#py_flag="python"
#py_flag="pypy"

proc_name="DtsServiceApi"

deploy_dir="/home/IOTPlatform/"
system_log_dir="/var/log/"
deploy_dir="${deploy_dir%/}"
system_log_dir="${system_log_dir%/}"
proc_start_log="/root/vcom/proc_start_all.log"
time_str=`date  +"%Y-%m-%d %H:%M:%S"`

proc_dir="${deploy_dir}/${proc_name}/"
proc_app="${deploy_dir}/${proc_name}/app.py"
mkdir  "${deploy_dir}/${proc_name}/logs"  -p
mkdir  "${system_log_dir}/${proc_name}/"  -p
# proc-log-start
echo "${time_str}--${proc_name}--start" >>${proc_start_log}
cd  ${proc_dir}

#nohup ${py_flag} ${proc_app}   > /dev/null &  
nohup ${py_flag} ${proc_app} --port=9701  > /dev/null &